﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSW.Security
{
    /// <summary>
    /// Security.UserRole.
    /// </summary>
    public partial class Security_UserRole
    {
        private Property<int> m_UserRoleID;
        private Property<string> m_UserID;
        private Property<int> m_RoleID;

        /// <summary>
        /// Called at the end of the constructor.
        /// </summary>
        protected override void base_OnCreated()
        {
            m_UserRoleID = new Property<int>(this, "UserRoleID");
            m_UserID = new Property<string>(this, "UserID");
            m_RoleID = new Property<int>(this, "RoleID");

            m_UserRoleID.IsReadOnly = true;

            m_UserID.MaxLength = 30;

            AddRequiredField(m_UserID, "User ID is required.");
            AddRequiredField(m_RoleID, "Role is required.");
        }

        private void GeneratedOnUserRoleIDChanging(int value)
        {
            m_UserRoleID.CheckEdittable();
        }

        private void GeneratedOnUserIDChanging(string value)
        {
            m_UserID.CheckEdittable();
        }

        private void GeneratedOnRoleIDChanging(int value)
        {
            m_RoleID.CheckEdittable();
        }
    }
}
